<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
              ... 展开运算符它是浅拷贝
              如果源对象某个属性的值是对象，那么目标对象拷贝得到的是这个对象的引用
             */
      let obj = { a: 1, d: { a: 1 } };
      let obj2 = { b: 1 };
      let obj3 = { c: 1 };
      let obj4 = { ...obj, ...obj2, ...obj3 };
      obj4.a = 2;
      obj4.d.a = 2;
      console.log(obj4, obj); //{a: 1, b: 1, c: 1}
    </script>
  </body>
</html>
